Conditions | 4 |
Total Lines | 19 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | interface InputEvent extends Event { |
||
10 | /** |
||
11 | * checkValidText is where we check if the text input is valid |
||
12 | * If it is, we enable the submit button |
||
13 | */ |
||
14 | |||
15 | const checkValidText = (event: InputEvent): void => { |
||
16 | const bilInformasjon = event?.target?.value; |
||
17 | const submitButton = window.document.getElementById( |
||
18 | "submitButton" |
||
19 | ) as SubmitButton; |
||
20 | |||
21 | const letters = /[A-Z]{2}\d{5}/gi; |
||
22 | const bilInformasjonMatchesFormat = letters.test(bilInformasjon); |
||
23 | |||
24 | console.log("bilInformasjon:", bilInformasjon); |
||
25 | console.log("bilInformasjonMatchesFormat: ", bilInformasjonMatchesFormat); |
||
26 | |||
27 | if ( |
||
28 | bilInformasjonMatchesFormat && |
||
29 | bilInformasjon !== undefined && |
||
39 |